-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update input formats for binary and point forecasts #460
Conversation
…s, update tests for point and binary forecasts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is in this PR, but also in #468. I think merging #468 first would be a bit cleaner (I decided midway to try and do things properly by making a separate PR to untangle the fix from the new feature...).
Nothing is stopping you from closing PRs and sorting this out and then reupdating them or even just updating the PR with a note. As a reviewer with limited time this is really quite frustrating practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine. Usual few linting issues which can resolve or not as you wish.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #460 +/- ##
==========================================
Coverage ? 81.21%
==========================================
Files ? 20
Lines ? 1725
Branches ? 0
==========================================
Hits ? 1401
Misses ? 324
Partials ? 0 ☔ View full report in Codecov by Sentry. |
Closes #424, where we discussed that binary and point forecasts so far didn't allow the following inputs:
The first one is very standard behaviour in R so it would be nice to support it and the second one makes the function more consistent with the input formats of e.g. quantile- and sample-based functions, which all expect
predicted
to be a matrix.This PR therefore updates the input checks for binary and point forecasts to allow these. It also expands tests to test the new input requirements.
To simplify code, it also creates a new helper function,
check_dims_ok_point()
andassert_dims_ok_point
that checks the dimensions for binary and point forecasts. (In the future we could also do something like that for quantile and sample-based forecasts, I added it to a new issue, #459.I added tests for the point inputs to the binary tests. My reasoning was that tests for binary and point inputs should always be very similar. Having them in one place makes it easier to not forget a test for point that we have for binary and vice versa. And I thought it would be a bit cleaner to have corresponding tests together. The test file for point metrics currently mostly has a few legacy tests from covidHubUtils. I couldn't bring myself to embark on a grand test clean-up right now, but I at least noted it in #346.
Note:
There's a small unrelated change mixed in this PR: see #468. The change was just removing old code remnants that weren't updated due to the same code being changed by 2 PRs:
correlation()
,check_metric()
, that should not exist anymore after all the updates.scores
toscores_quantile
in a failing test that got updated on dev previously, but not in all the branches we merged.The change is in this PR, but also in #468. I think merging #468 first would be a bit cleaner (I decided midway to try and do things properly by making a separate PR to untangle the fix from the new feature...).